Skip to content

Load contract state files in tests with the full state size - #1059

Open
fnordspace wants to merge 1 commit into
developfrom
bugfix/2026-10-28-ContractStateFileSize
Open

fnordspace wants to merge 1 commit into
developfrom
bugfix/2026-10-28-ContractStateFileSize

Conversation

@fnordspace

Copy link
Copy Markdown
Contributor

The QX and QSWAP test fixtures loaded state files with sizeof(QX) / sizeof(QSWAP). Since state moved to StateData, those classes are empty (sizeof = 1), so loadState() read 1 byte, returned true, and the tests ran on an empty state. ContractQx.BugEntityBidOrders and ContractQx.CleanupCollections passed without testing anything.

  • Add ContractTesting::loadContractState(). It takes the size from contractDescriptions and only loads a file whose size matches exactly; otherwise the test skips and prints the actual and expected sizes.
  • Both fixtures now use it.

@fnordspace fnordspace self-assigned this Oct 28, 2026
@fnordspace fnordspace added the bug Something isn't working label Oct 28, 2026
@fnordspace fnordspace added this to qubic Oct 28, 2026
@fnordspace fnordspace moved this to 👀 In review in qubic Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Status: 👀 In review

Development

Successfully merging this pull request may close these issues.

2 participants